module libeventd.buffer.event.Ssl;

import
	libeventd.Types;

enum bufferevent_ssl_state {
	BUFFEREVENT_SSL_OPEN = 0,
	BUFFEREVENT_SSL_CONNECTING = 1,
	BUFFEREVENT_SSL_ACCEPTING = 2,
}

extern(C):
struct ssl_st;
version(_EVENT_HAVE_OPENSSL) {
	bufferevent* bufferevent_openssl_filter_new(event_base *base, bufferevent *underlying, ssl_st *ssl,  bufferevent_ssl_state state,  ev_int options);
	bufferevent* bufferevent_openssl_socket_new(event_base *base, evutil_socket_t fd, ssl_st *ssl, bufferevent_ssl_state state, ev_int options);
	ssl_st* bufferevent_openssl_get_ssl(bufferevent *bufev);
	ev_int bufferevent_ssl_renegotiate(bufferevent *bev);
	ev_ulong bufferevent_get_openssl_error(bufferevent *bev);
}
